/*
 * Copyright @2009-2012 www.happyelements.com, all rights reserved.
 * Create date: 2012-7-30
 * Chengzhi.yin	
 * 尹成志
 * chengzhi.yin@happyelements.com
 */
package com.happyelements.components
{
	import flash.filesystem.File;
	import flash.filesystem.FileMode;
	import flash.filesystem.FileStream;

	 public class WriteFile
	 {
		 private var _sourceData:String;

		 private var _outputPath:String;
		 
		 public function WriteFile(sourceData:String, outputPath:String)
		 {
			 this._sourceData = sourceData;
			 this._outputPath = outputPath;
		 }
		 
		 public function write():void
		 {
			 var file:File = new File(this._outputPath);
			 var fs:FileStream = new FileStream();
			 fs.open(file,FileMode.WRITE);
			 fs.position = 0;
			 fs.writeUTFBytes(this._sourceData);
			 fs.close();
		 }
	 }
}